<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>未服务项目</title>
<jsp:include page="/WEB-INF/backstage/util.jsp"/>
</head>
<!-- <body style="margin: 30px;"> -->
	<body>
		<center>
			<!-- 条件查询表单 -->
				<form class="form-inline" action="${pageContext.request.contextPath }/zjj/selectBis_business_order2" method="post" name="myform" id="myform">
					<input type="hidden" name="custom_user_id" value="${custom_user_id }"/>
					<table>
						<tr align="center">
							<td align="right">
								<div class="form-group">
									<label for="order_id">订单编号：</label>
								</div>
							</td>
							<td align="left">
								<div class="form-group">
									<input type="text" class="form-control" id="order_id" name="order_id" value="${order_id }" >
								</div>
							</td>
							<td align="right">
								<div class="form-group">
									<label for="order_content">消费内容：</label>
								</div>
							</td>
							<td align="left">
								<div class="form-group">
									<input type="text" class="form-control" id="order_content" name="order_content" value="${order_content }">
								</div>
							</td>
							<td align="right">
								<div class="form-group">
									<label for="shop_id">店铺名称：</label>
								</div>
							</td>
							<td align="left">
								<div class="form-group">
									<select class="form-control" name="shop_id" id="shop_id">
									  	<option value="" selected="selected">请选择~！</option>
									  	<c:forEach items="${list2 }" var="list2">
											<option value="${list2.shop_id }">${list2.shop_name }</option>
										</c:forEach>
									</select>
								</div>
							</td>
							<td align="right">
								<div class="form-group">
									<label for="subscribe_time">预约日期：</label>
								</div>
							</td>
							<td align="left">
								<div class="form-group">
									<input type="date" class="form-control" id="subscribe_time1" name="subscribe_time1" value="<f:formatDate value='${subscribe_time1 }' pattern='yyyy-MM-dd'/>">
									至：
									<input type="date" class="form-control" id="subscribe_time2" name="subscribe_time2" value="<f:formatDate value='${subscribe_time2 }' pattern='yyyy-MM-dd'/>">
								</div>
							</td>
						</tr>
						<!-- 表单按钮组 -->
						<tr>
							<td>
								<button class="btn btn-primary btn-sm" type="submit" name="zjjinquiry" id="zjjinquiry">
									<span class="glyphicon glyphicon-search" aria-hidden="true"></span>&nbsp;&nbsp;查询
								</button>
							</td>
							&nbsp;&nbsp;&nbsp;&nbsp;
							<td>
								<button class="btn btn-primary btn-sm" type="button" name="zjjresetting" id="zjjresetting">
									<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>&nbsp;&nbsp;重置
								</button>
							</td>
						</tr>
					</table>
				</form>
			
			<!-- 显示数据 -->
			<table class="table table-bordered table-condensed table-hover">
				<tr align="center">
					<td></td>
					<td>订单编号</td>
					<td>消费内容</td>
					<td>价格（元）</td>
					<td>店铺编号</td>
					<td>店铺名称</td>
					<td>创建时间</td>
					<td>预约时间</td>
					<td>撤销/过期时间</td>
					<td>状态</td>
					<td>查看详情</td>				
				</tr>
				<c:forEach items="${info.list }" var="list" varStatus="s">
						<tr align="center">
							<td>${s.index+1 }</td>
							<td>${list.order_id }</td>
							<td>${list.order_content }</td>
							<td>${list.order_money }</td>
							<td>${list.shop_id }</td>
							<td>${list.shop_name }</td>
							<td>${list.create_time }</td>
							<td>${list.subscribe_time }</td>
							<td>${list.cancel_time }</td>
							<%-- <td>${list.order_status }</td> --%>
							<td>${list.order_status=="0"?"草稿":list.order_status=="1"?"已预约":list.order_status=="2"?"服务中":list.order_status=="3"?"待支付":list.order_status=="4"?"已支付":list.order_status=="5"?"已完成":list.order_status=="6"?"已过期":"已撤销" }</td>
							<%-- <td>
								<c:if test="${list.order_status==0 }">
									草稿
								</c:if>
								<c:if test="${list.order_status==1 }">
									已预约
								</c:if>
								<c:if test="${list.order_status==2 }">
									服务中
								</c:if>
								<c:if test="${list.order_status==3 }">
									待支付
								</c:if>
								<c:if test="${list.order_status==4 }">
									已支付
								</c:if>
								<c:if test="${list.order_status==5 }">
									已完成
								</c:if>
								<c:if test="${list.order_status==6 }">
									已过期
								</c:if>
								<c:if test="${list.order_status==7 }">
									已撤销
								</c:if>
							</td> --%>
							<td>
								<button class="btn btn-primary btn-xs" type="button" onclick="test111(this)" data-toggle="modal" data-target="#myModal11" data-backdrop="static">
									<span class="glyphicon glyphicon-search" aria-hidden="true"></span>&nbsp;&nbsp;查看详情
								</button>
							</td>
						</tr>
					</c:forEach>			
			</table>
			
			<!-- 查看详情模态框 -->
			<div class="modal fade bs-example-modal-lg" id="myModal11" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
				<div class="modal-dialog modal-lg" role="document">
					<div class="modal-content">
						<div class="modal-header">
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					    	<h4 class="modal-title" align="left">未服务项目查看详情</h4>
					    </div>
					    <div class="modal-body">
					    	<fieldset disabled>		      	
						    <table>
						    	<tr>
						      		<td>
						    			<div class="form-group" align="left">
						    				<label for="order_id">订单编号：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="order_id" id="order_id1" value="">
										</div>
						    		</td>
						    		<td>
						    			<div class="form-group" align="left">
						    				<label for="order_content">消费内容：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="order_content" id="order_content1" value="">
										</div>
						    		</td>
						    		<td>
						    			<div class="form-group" align="left">
						    				<label for="order_money">价格（元）：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="order_money" id="order_money1" value="">
										</div>
						    		</td>
						      	</tr>
						      	<tr>
						      		<td>
						    			<div class="form-group" align="left">
						    				<label for="shop_id">店铺编号：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="shop_id" id="shop_id1" value="">
										</div>
						    		</td>
						    		<td>
						    			<div class="form-group" align="left">
						    				<label for="shop_name">店铺名称：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="shop_name" id="shop_name1" value="">
										</div>
						    		</td>
						    		<td>
						    			<div class="form-group" align="left">
						    				<label for="create_time">创建时间：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="create_time" id="create_time1" value="">
										</div>
						    		</td>
						      	</tr>
						      	<tr>
						      		<td>
						    			<div class="form-group" align="left">
						    				<label for="subscribe_time">预约时间：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="subscribe_time" id="subscribe_time11" value="">
										</div>
						    		</td>
						    		<td>
						    			<div class="form-group" align="left">
						    				<label for="cancel_time">撤销/过期时间：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="cancel_time" id="cancel_time1" value="">
										</div>
						    		</td>
						    		<td>
						    			<div class="form-group" align="left">
						    				<label for="order_status">状态：</label>
						    			</div>
						    		</td>
						    		<td>
						    			<div class="form-group">
											<input type="text" class="form-control" name="order_status" id="order_status1" value="">
										</div>
						    		</td>
						      	</tr>
						    </table>
						    </fieldset>
					   	</div>
					</div>
				</div>
			</div>

			<!-- 分页 -->
			<a href="#" onclick="first()">首页</a>
			&nbsp;&nbsp;&nbsp;
			<a href="#" onclick="pre()">上一页</a>
			&nbsp;&nbsp;&nbsp;
			<a href="#" onclick="next()">下一页</a>
			&nbsp;&nbsp;&nbsp;
			<a href="#" onclick="last()">尾页</a>

	</center>
</body>
<script type="text/javascript">
	//条件查询定值方法
	$(function(){
		$("#shop_id").val('${shop_id}');
	})

	/* function test1(){
		myform.action="${pageContext.request.contextPath }/zjj/selectBis_business_order";
		myform.submit();
	} */
	
	//分页
	//首页
	function first(){
		document.forms[0].action="${pageContext.request.contextPath }/zjj/selectBis_business_order2?page=${info.firstPage}";
		document.forms[0].submit();
	}
	//上一页
	function pre(){
		document.forms[0].action="${pageContext.request.contextPath }/zjj/selectBis_business_order2?page=${info.prePage}";
		document.forms[0].submit();
	}
	//下一页
	function next(){
		document.forms[0].action="${pageContext.request.contextPath }/zjj/selectBis_business_order2?page=${info.nextPage}";
		document.forms[0].submit();
	}
	//尾页
	function last(){
		document.forms[0].action="${pageContext.request.contextPath }/zjj/selectBis_business_order2?page=${info.lastPage}";
		document.forms[0].submit();
	}
	
	//点击重置按钮 重置
	$("#zjjresetting").click(
		function() {
			$("#order_id").val("");
			$("#order_content").val("");
			$("#pay_way").val("");
			$("#order_status").val("");
			$("#shop_id").val("");
			$("#server_user_id").val("");
			$("#handle_user_id").val("");
			$("#subscribe_time1").val("");
			$("#subscribe_time2").val("");
		}
	);
	
	//点击查看详情将当前行数据传递到模态框
	function test111(obj) {
		//获取当前点击行的id
		var $td = $(obj).parents('tr').children('td');
		var id = $td.eq(1).text();
		$("#order_id1").val(id);//将获取的该行的id值填充到模态框的文框中，文本框的ID为itemmodalid，其他的数据也是如此处理
		var order_content1 = $td.eq(2).text();
		$("#order_content1").val(order_content1);
		var order_money1 = $td.eq(3).text();
		$("#order_money1").val(order_money1);
		
		var shop_id1 = $td.eq(4).text();
		$("#shop_id1").val(shop_id1);
		var shop_name1 = $td.eq(5).text();
		$("#shop_name1").val(shop_name1);
		var create_time1 = $td.eq(6).text();
		$("#create_time1").val(create_time1);
		
		var subscribe_time11 = $td.eq(7).text();
		$("#subscribe_time11").val(subscribe_time11);
		var cancel_time1 = $td.eq(8).text();
		$("#cancel_time1").val(cancel_time1);
		var order_status1 = $td.eq(9).text();
		$("#order_status1").val(order_status1);
	}
</script>
</html>